/*
Copyright 2010 SGSL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import com.dataiti.sgsl.SGSLApplet;

/**
 * This applet class inherit the functionality of SGSLApplet to draw globe
 * with added features
 * 
 * 
 */
public class TestSimple1 extends SGSLApplet {

	private static final long serialVersionUID = 1L; // silence warning
	
	
	
	
	/**
	 * Implement this method to draw different objects on the globe 
	 * 
	 */
	public final void draw() {
//		setColor(black);

		//
		// let's draw a graph centered approximately on Boston, MA, USA.
		//
		//		setCenter(42.3, 360-72.2); // west longitude means 360 minus the value.
		//	
		//	
		//	//	 setWidthAndHeight(5);
		//		
		//		 // change to 3 (zoom in) causes null pointer
		//		 setDrawPositionLon(360-72);
		//		 setDrawPositionLat(42);
		//		 drawPoint();
		//		 setLabelSize(0.2);
		//		 drawLabel("boston");
		//		 drawCircle(3);
		//		 
		//		 printMessage("this is some text.\n and some more");
		//		 setGridLines(true);
		
		setDrawingPosition(15, 30);
		setLabelSize(0.02);
		drawLabel("label whose leftmost text begins at 15N 30E");
		drawFilledCircle(2);
		//double radius = (360/24.0); // There are 24 longitude lines in the grid. Let's match grid lines (I hope)
		                            // at any given latitude a circle of this radius whose center is at longitude 0 should
		                            // just touch the longitude lines on either side.
		//double lon = 90.0;
		//double lat = 90.0 - radius;
		//setCenter(90,0.0); // north pole
		//setWidthAndHeight(100); // should show earth to approximately 40 degrees north latitude. 
		//setDrawingPosition(lat, lon);
		//drawPoint();
		/*setLabelSize(0.02);
		drawLabel(lat + "," + lon);
		setColor(black);
		drawCircle(radius);
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(blue);
		drawCircle(radius); // should be larger on screen
		lat -= radius;
		setDrawingPosition(lat,lon);
		drawLabel(lat + "," + lon);
		setColor(darkGray);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(gray);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(green);
		drawCircle(radius); // larger still.
		drawLabel(lat + "," + lon);
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(lightGray);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(magenta);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(orange);
		drawLabel(lat + "," + lon);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(pink);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(red);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(white);
		drawCircle(radius); // larger still.
		lat -= radius;
		setDrawingPosition(lat,lon);
		setColor(yellow);
		drawCircle(radius); // larger still.

		lat -= radius;
		for (int i = 0; i < 100; i++) {
			printMessage("Message " + i + ": this is some text.\n and some more\n");
		}

		//		 setWidthAndHeight(140);
		//		 drawCircle(150);
*/
		setGridLines(true);

	}

}
